package pl.edu.utp.calculations;

import java.util.Comparator;
import pl.edu.utp.ga.Individual;

public class IndividualComparator implements Comparator<Individual>{

	@Override
	public int compare(Individual o1, Individual o2) {
		double individual1Rate = o1.getRate();
		double individual2Rate = o2.getRate();
		if(individual1Rate > individual2Rate)
			return 1;
		else if(individual1Rate < individual2Rate)
			return -1;
		else
			return 0;
	}
}